<?php

namespace app\enterprise\controller;

use app\adminapi\controller\AuthController;
use app\enterprise\model\Parameter as parameterModel;

class Parameter extends AuthController
{



    public function listAll()
    {
        $param = $this->request->param();
        $where = [];
        if (!empty($param['type'])) {
            $where[] = ['type', '=', $param['type']];
        }
        $data = parameterModel::list($where);

        return app('json')->success($data);
    }

    public function listType4()
    {
        $param = $this->request->param();
        $where[] = ['company_id', '=', $this->adminInfo['company_id']];
        $where[] = ['status', '=', 1];
        $list = $data = \app\model\staff\Position::where($where)->select()->toArray();
         $list = arrayToTree($list);
        return app('json')->success([
            'list' => $list
        ]);
    }

}